<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>QCNSim: QcnSim/Token.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">QCNSim
   </div>
   <div id="projectbrief">Simulator for Quake-Catcher Network</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d21be12960473ba5c51e5f9beea3525e.html">QcnSim</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Token.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="_token_8h_source.html">Token.h</a>&quot;</code><br/>
</div>
<p><a href="_token_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a2f9ac044b605d23a98ae473993b15f22"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_token_8cpp.html#a2f9ac044b605d23a98ae473993b15f22">operator==</a> (const <a class="el" href="class_token.html">Token</a> &amp;left, const <a class="el" href="class_token.html">Token</a> &amp;right)</td></tr>
<tr class="separator:a2f9ac044b605d23a98ae473993b15f22"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f52a7ce33f63dc1b326c6c5863bb670"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_token_8cpp.html#a6f52a7ce33f63dc1b326c6c5863bb670">operator!=</a> (const <a class="el" href="class_token.html">Token</a> &amp;left, const <a class="el" href="class_token.html">Token</a> &amp;right)</td></tr>
<tr class="separator:a6f52a7ce33f63dc1b326c6c5863bb670"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a6f52a7ce33f63dc1b326c6c5863bb670"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool operator!= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_token.html">Token</a> &amp;&#160;</td>
          <td class="paramname"><em>left</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_token.html">Token</a> &amp;&#160;</td>
          <td class="paramname"><em>right</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Operator != (not equal) overloading.</p>
<p>This is the overloading of the comparison != operator for use with token. The result should be FALSE if the left token has the same relevant contents as the right token. It should suffice to compare the unique IDs, but let's just do it the redundant way.</p>
<p>Note that, if comparisons are being made with shared pointers, this function will actually not be used. The shared pointers will perform the comparisons "internally."</p>
<p>Also note that this function is simple the negation of == operator. It is being implemented for the sake of fundamental rule of operator overloading.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">left</td><td>The <a class="el" href="class_token.html" title="Token class. ">Token</a> object to the "left", to be compared with the "right". </td></tr>
    <tr><td class="paramname">right</td><td>The <a class="el" href="class_token.html" title="Token class. ">Token</a> object to the "right", to be compared with the "left". </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_token_8cpp_source.html#l00331">331</a> of file <a class="el" href="_token_8cpp_source.html">Token.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;                                                        {</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;    <span class="keywordflow">return</span> !<a class="code" href="_event_8cpp.html#a33b5ef8ac3e21f9d655b1db577e0e69e">operator==</a>(left, right);</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;}</div>
<div class="ttc" id="_event_8cpp_html_a33b5ef8ac3e21f9d655b1db577e0e69e"><div class="ttname"><a href="_event_8cpp.html#a33b5ef8ac3e21f9d655b1db577e0e69e">operator==</a></div><div class="ttdeci">bool operator==(const Event &amp;left, const Event &amp;right)</div><div class="ttdef"><b>Definition:</b> <a href="_event_8cpp_source.html#l00048">Event.cpp:48</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a2f9ac044b605d23a98ae473993b15f22"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_token.html">Token</a> &amp;&#160;</td>
          <td class="paramname"><em>left</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_token.html">Token</a> &amp;&#160;</td>
          <td class="paramname"><em>right</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy constructor.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">source</td><td><a class="el" href="class_token.html" title="Token class. ">Token</a> object that will be copied. Move constructor.</td></tr>
  </table>
  </dd>
</dl>
<p>This is used per The Big Three Rule, or The Four or Five Rule (<a href="http://stackoverflow.com/questions/4172722/what-is-the-rule-of-three">http://stackoverflow.com/questions/4172722/what-is-the-rule-of-three</a>).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">source</td><td>The "source" <a class="el" href="class_token.html" title="Token class. ">Token</a> object that will have its resources moved to the current object. The "source" object will likely be destroyed afterwards. Operator = (assignment) overloading.</td></tr>
  </table>
  </dd>
</dl>
<p>This is the overloading of the assignment operator for use with token. Necessary because a member of the <a class="el" href="class_token.html" title="Token class. ">Token</a> class is a reference (&amp;entity). This is used per The Big Three Rule, or The Four or Five Rule (<a href="http://stackoverflow.com/questions/4172722/what-is-the-rule-of-three">http://stackoverflow.com/questions/4172722/what-is-the-rule-of-three</a>).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">right</td><td>The <a class="el" href="class_token.html" title="Token class. ">Token</a> object to the right of the assignment operator. Operator == (equal) overloading.</td></tr>
  </table>
  </dd>
</dl>
<p>This is the overloading of the comparison == operator for use with token. The result should be TRUE if the left token has the same contents as the right token. It should suffice to compare the unique IDs, but let's just do it the redundant way.</p>
<p>Note that, if comparisons are being made with shared pointers, this function will actually not be used. The shared pointers will perform the comparisons "internally."</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">left</td><td>The <a class="el" href="class_token.html" title="Token class. ">Token</a> object to the "left", to be compared with the "right". </td></tr>
    <tr><td class="paramname">right</td><td>The <a class="el" href="class_token.html" title="Token class. ">Token</a> object to the "right", to be compared with the "left". </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_token_8cpp_source.html#l00308">308</a> of file <a class="el" href="_token_8cpp_source.html">Token.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;                                                        {</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    <span class="keywordflow">return</span> (left.<a class="code" href="class_token.html#a29cd5cc1dd308d278737f1bdb293441d">id</a> == right.<a class="code" href="class_token.html#a29cd5cc1dd308d278737f1bdb293441d">id</a> &amp;&amp; left.<a class="code" href="class_token.html#a8125cc8499770f87f3540c81f889e039">priority</a> == right.<a class="code" href="class_token.html#a8125cc8499770f87f3540c81f889e039">priority</a> &amp;&amp; left.<a class="code" href="class_token.html#afefc7a53c3510da4a70ec2a9f15b9dc2">associatedEntity</a> == right.<a class="code" href="class_token.html#afefc7a53c3510da4a70ec2a9f15b9dc2">associatedEntity</a> &amp;&amp;</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;        left.<a class="code" href="class_token.html#a1647ede32e4d927f836a0f58342d77b2">previous</a> == right.<a class="code" href="class_token.html#a1647ede32e4d927f836a0f58342d77b2">previous</a> &amp;&amp; left.<a class="code" href="class_token.html#afc3016125b848c7e88fc5dc8510762ef">next</a> == right.<a class="code" href="class_token.html#afc3016125b848c7e88fc5dc8510762ef">next</a> &amp;&amp; left.<a class="code" href="class_token.html#afb12b6d97945606e022f63ef6f1057b9">source</a> == right.<a class="code" href="class_token.html#afb12b6d97945606e022f63ef6f1057b9">source</a> &amp;&amp; left.<a class="code" href="class_token.html#adf59bd26155dc10e574ee552065edaa6">destination</a> == right.<a class="code" href="class_token.html#adf59bd26155dc10e574ee552065edaa6">destination</a> &amp;&amp;</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;        left.<a class="code" href="class_token.html#ae1697de3383688ddbe8196cb392bf2ac">absoluteGenerationTime</a> == right.<a class="code" href="class_token.html#ae1697de3383688ddbe8196cb392bf2ac">absoluteGenerationTime</a>);</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;}</div>
<div class="ttc" id="class_token_html_a1647ede32e4d927f836a0f58342d77b2"><div class="ttname"><a href="class_token.html#a1647ede32e4d927f836a0f58342d77b2">Token::previous</a></div><div class="ttdeci">std::shared_ptr&lt; Entity &gt; previous</div><div class="ttdoc">Previous entity that had this token (for token routing). </div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00056">Token.h:56</a></div></div>
<div class="ttc" id="class_token_html_afefc7a53c3510da4a70ec2a9f15b9dc2"><div class="ttname"><a href="class_token.html#afefc7a53c3510da4a70ec2a9f15b9dc2">Token::associatedEntity</a></div><div class="ttdeci">std::shared_ptr&lt; Entity &gt; associatedEntity</div><div class="ttdoc">Reference to associated Entity object (typically another child of Entity class). </div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00055">Token.h:55</a></div></div>
<div class="ttc" id="class_token_html_afc3016125b848c7e88fc5dc8510762ef"><div class="ttname"><a href="class_token.html#afc3016125b848c7e88fc5dc8510762ef">Token::next</a></div><div class="ttdeci">std::shared_ptr&lt; Entity &gt; next</div><div class="ttdoc">Next entity that will have to process this token (to which entity the token has to be &amp;quot;sent&amp;quot;...</div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00057">Token.h:57</a></div></div>
<div class="ttc" id="class_token_html_ae1697de3383688ddbe8196cb392bf2ac"><div class="ttname"><a href="class_token.html#ae1697de3383688ddbe8196cb392bf2ac">Token::absoluteGenerationTime</a></div><div class="ttdeci">double absoluteGenerationTime</div><div class="ttdoc">Absolute generation timestamp for this token (i.e., the clock time this token was generated)...</div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00047">Token.h:47</a></div></div>
<div class="ttc" id="class_token_html_afb12b6d97945606e022f63ef6f1057b9"><div class="ttname"><a href="class_token.html#afb12b6d97945606e022f63ef6f1057b9">Token::source</a></div><div class="ttdeci">std::shared_ptr&lt; Entity &gt; source</div><div class="ttdoc">Source entity of this token. </div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00058">Token.h:58</a></div></div>
<div class="ttc" id="class_token_html_adf59bd26155dc10e574ee552065edaa6"><div class="ttname"><a href="class_token.html#adf59bd26155dc10e574ee552065edaa6">Token::destination</a></div><div class="ttdeci">std::shared_ptr&lt; Entity &gt; destination</div><div class="ttdoc">Destination entity of this token. </div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00059">Token.h:59</a></div></div>
<div class="ttc" id="class_token_html_a29cd5cc1dd308d278737f1bdb293441d"><div class="ttname"><a href="class_token.html#a29cd5cc1dd308d278737f1bdb293441d">Token::id</a></div><div class="ttdeci">unsigned int id</div><div class="ttdoc">Token unique ID. </div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00051">Token.h:51</a></div></div>
<div class="ttc" id="class_token_html_a8125cc8499770f87f3540c81f889e039"><div class="ttname"><a href="class_token.html#a8125cc8499770f87f3540c81f889e039">Token::priority</a></div><div class="ttdeci">int priority</div><div class="ttdoc">Token priority. Higher priority, higher number. </div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00052">Token.h:52</a></div></div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Jan 6 2014 12:30:39 for QCNSim by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
